{include file="include:header" /}
<!-- 首页 -->
<script src="__PUBLICINDEX__/js/pay/pingpp.js"></script>

<body >
<input type="button" name="" value="购买" id="pay">

<div id="qrcode"></div>
<img src="{$wx_pub_qr}" width="300px;">

</body>
</html>
{include file="include:js" /}
<script src="__PUBLICINDEX__/js/jquery.qrcode.min.js"></script>
<script>
 jQuery('#qrcode').qrcode({
    render: "canvas", //也可以替换为table
    width: 200,
    height: 200,
    text: "{$wx_pub_qr}"
});
            //支付宝支付使用 
          $.get(http_url+'pcpay/pay_ajax',function(response){
              pingpp.createPayment(response, function(result, err){
                console.log(response);
                console.log(err.msg);
                console.log(err.extra);
                if (result == "success") {
                    // 只有微信公众账号 wx_pub 支付成功的结果会在这里返回，其他的支付结果都会跳转到 extra 中对应的 URL。
                } else if (result == "fail") {
                    // charge 不正确或者微信公众账号支付失败时会在此处返回
                } else if (result == "cancel") {
                    // 微信公众账号支付取消支付
                }
            });
          },'json');

</script>